//
//  SFSpreadTextView.h
//  Test
//
//  Created by xueshan1 on 2019/2/14.
//  Copyright © 2019 xueshan1. All rights reserved.
//
/*
 基于UITextView
 1.在文本最后增加 "...展开" 功能
 2.可添加富文本(字体颜色)
 3.可添加"点击文本", 
 */

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@class SFSpreadTextView;
@protocol SFSpreadTextViewDelegate <NSObject>

/**
 展开按钮
 */
- (void)spreadButtonClicked:(SFSpreadTextView *)textView;
/**
 链接文本
 */
- (void)spreadTextView:(SFSpreadTextView *)textView lineText:(NSString *)lineText lineScheme:(NSString *)lineScheme;

@end

@interface SFSpreadTextView : UIView

@property(nonatomic,weak)id delegate;
@property(nonatomic,copy)NSString *content;
@property(nonatomic,strong)UIFont *contentFont;
@property(nonatomic,assign)NSInteger maxLine;//最多展示几行
@property(nonatomic,copy)NSString *spreadBtnTitle; //"展开"标题
@property(nonatomic,assign)BOOL needShrink;//展开后需要收起


/**
 赋值完刷新
 */
- (void)reloadTextView;

/*
 富文本
 晚于 reload 调用
 */
- (void)addColorTextRange:(NSRange)colorRange color:(UIColor *)color;

/**
 链接文本
 @param scheme 必须是 英文
 */
- (void)addLinkTextWithScheme:(NSString *)scheme linkColor:(UIColor *)linkColor inRange:(NSRange)linkRange;


@end


NS_ASSUME_NONNULL_END
